
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>资产报修</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, user-scalable=no">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta name=”apple-mobile-web-app-status-bar-style” content=”default” />
    <meta name=”apple-mobile-web-app-status-bar-style” content=”black” />
    <meta name=”apple-mobile-web-app-status-bar-style” content=”black-translucent” />
    <meta content="telephone=no" name="format-detection">
    <meta content="email=no" name="format-detection">
    <meta name="format-detection" content="telephone=no"/>
    <script type="text/javascript" src="${s.base}/mobile/js/jquery-2.1.4.min.js"></script>
    <script type="text/javascript" src="${s.base}/mobile/js/ajaxfileupload.js"></script>
    <link href="${s.base}/mobile/css/weui.min.css" rel="stylesheet" />
    <link href="${s.base}/mobile/css/jquery-weui.css" rel="stylesheet"/>
    <link href="${s.base}/mobile/css/jquery-weui.min.css" rel="stylesheet"/>
    <link href="${s.base}/mobile/css/weChat.css" rel="stylesheet" />
    <script type="text/javascript" src="${s.base}/mobile/js/fontSize.js"></script>
    <script type="text/javascript" src="${s.base}/mobile/js/window_port.js"></script>
</head>
<body class="cyt-body-gray" style="">
<div class="cyt-form-bar">
    <div class="cyt-input-line"><label class="weui-label"><span class="cy-must">*</span>申请部门</label>
        <!--<span class="cy-must">*</span><label>申请部门</label>-->
        <input type="text" id="organName" placeholder="请输入申请部门" />
    </div>
    <div class="cyt-input-line"><label class="weui-label"><span class="cy-must">*</span>联系方式</label>
        <!--<span class="cy-must">*</span><label>联系方式</label>-->
        <input type="text" id="mobile" placeholder="请输入联系方式" />
    </div>
    <div class="cyt-input-line"><label class="weui-label"><span class="cy-must">*</span>物品类型</label>
        <!--<span class="cy-must">*</span><label>物品类型</label>-->
        <input type="text" id="type" placeholder="请输入物品类型">
    </div>
    <div class="cyt-input-line"><label class="weui-label"><span class="cy-must">*</span>物品名称</label>
        <!--<span class="cy-must">*</span><label>物品名称</label>-->
        <input type="text" id="title" placeholder="请输入物品名称" />
    </div>
    <div class="cyt-input-line"><label class="weui-label"><span class="cy-must">*</span>物品地点</label>
        <!--<span class="cy-must">*</span><label>物品地点</label>-->
        <input type="text" id="location" placeholder="请输入物品地点" />
    </div>
</div>
<div class="cyt-form-bar">
    <div class="cyt-content-line">
       <label>故障描述</label>
        <textarea placeholder="请输入物品故障描述"  id="cause" rows="3"></textarea>
    </div>
</div>
<!--<div class="cyt-form-bar" style="margin-bottom: 1.2rem;">-->
    <!--<div class="cyt-content-line clearfix">-->
        <!--<label>上传照片</label>-->
        <!--<div class="pic-add" id="photo"></div>-->

    <!--</div>-->
<!--</div>-->
<div class="cyt-form-bar">
    <div class="cyt-content-line">
        <div class="weui-uploader">
            <div class="weui-uploader__hd">
                <p class="weui-uploader__title">图片：</p>
                <div class="weui-uploader__info"></div>
            </div>
            <div class="weui-uploader__bd">
                <ul class="weui-uploader__files" id="showCLJG" data-objectId="">

                </ul>
                <div class="weui-uploader__input-box pic-add" style="margin-top: 0.12rem; border:none;">
                    <input id="fileCLJG"  name="file" onchange="cytImgUpload('fileCLJG','work/asset/mult','showCLJG','${userId}')"  class="weui-uploader__input" type="file" accept="image/*" multiple>
                </div>
            </div>
        </div>
</div>
</div>
<!--<div class="layui-form-item">-->
    <!--<label class="layui-form-label"><span class="red">*</span>&nbsp;图片：</label>-->
    <!--<div class="layui-input-block cy-uploadpic-ctn" id="photo" style=" float:left;margin-left:0!important;position:relative;"></div>-->
<!--</div>-->
<div class="xf-line-botbtn" id="save" style="position:initial; margin:0.4rem auto 0 auto;">提交</div>
</body>
<script src="${s.base}/mobile/js/jquery-weui.js"></script>
<script src="${s.base}/lib/layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script src="${s.base}/js/common.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
    layui.use(['jquery', 'form', 'page', 'laydate', 'fileUtil', 'baseutil'], function () {
        var $ = layui.jquery,
            baseutil = layui.baseutil;
            fileUtil = layui.fileUtil,

        //保存操作
        $("#save").on("click", function () {
            var organName = $("#organName").val();
            var mobile = $("#mobile").val();
            var type = $("#type").val();
            var title = $("#title").val();
            var location = $("#location").val();
            var cause = $("#cause").val();
            //var organName = $("#organName").val();//图片
            if (organName == null || organName == "") {
                $.toast("请输入申请部门", "text");
                return false;
            }
            if (mobile == null || mobile == "") {
                $.toast("请输入手机号码", "text");
                return false;
            }
            if(!(/^1[3456789]\d{9}$/.test(mobile))){
                $.toast("请输入正确手机号码", "text");
                return false;
            }
            if (type == null || type == "") {
                $.toast("请输入物品类型", "text");
                return false;
            }
            if (title == null || title == "") {
                $.toast("请输入物品名称", "text");
                return false;
            }
            if (location == null || location == "") {
                $.toast("请输入物品地点", "text");
                return false;
            }
            $.confirm("是否提交报修申请","温馨提示", function () {
                var str ='${token}';
                var str1='${applyId}';
                var attaObjectId = $("#showCLJG").attr("data-objectId");//附件id
                $.showLoading("正在提交中");
                baseutil.post("/phone/asset/addOrUpdate", {
                    applyId: str1,
                    userId: str,
                    organName: organName,
                    mobile: mobile,
                    assetType: type,
                    title: title,
                    location: location,
                    description: cause,
                    objectId: attaObjectId,
                    assetState: "0"
                }, function (result) {
                    $.hideLoading();
                    if (result.code == 0) {
                        $.toast("提交成功", "text");
                        window.location.href = "/phone/work/assetList?token="+str+"&applyId="+str1;
                    } else {
                        $.toast(result.data.msg, "text");
                    }
                }, "json");
            }, function () {
                //点击取消后的回调函数
            });

        });

    });






</script>
</html>
